//
//  UIImageView+Circle.m
//  ShanMei
//
//  Created by huazi on 15/3/17.
//  Copyright (c) 2015年 huazi. All rights reserved.
//

#import "UIImageView+Circle.h"

@implementation UIImageView (Circle)
- (void)setCircle
{
    self.layer.cornerRadius =self.frame.size.width/2;
    self.layer.masksToBounds =YES;

}

+(UIImage*)imageWithColor:(UIColor*) color
{
    CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
}

@end
